#ifndef __case_processbar_kenny_kfjiweur89u83r33e3e__
#define __case_processbar_kenny_kfjiweur89u83r33e3e__

#include <thread>

#include <hude/base/log.hpp>

#include "test/test.hpp"

namespace test
{
    using namespace hude;

    //--------------------------------------------------------------------------------
    struct case_processbar_t : public hude::test::case_t
    {
        //--------------------------------------------------------------------------------
        bool run() override
        {
            auto fn = []( double zoom )
            {
                hude::procbar_t pbar( 0.0f, zoom, '#', '_' );

                hude::format_t _zoom( "zoom %1.1f", zoom );

                for( size_t i = 0; i < 101; ++i )
                {
                    pbar( (double)i, _zoom.c_str() );

                    std::this_thread::sleep_for( std::chrono::milliseconds( 3U ) );
                }
            };

            for( double z = 1.5f; z > 0.1f; z -= 0.25f ) { fn( z ); }

            return true;
        }
    };

    //--------------------------------------------------------------------------------
    TEST_CASE_ADD( "procbar", case_processbar_t, false );

} //namespace test

#endif //__case_processbar_kenny_kfjiweur89u83r33e3e__
